#include "form.h"
#include "ui_form.h"

Form::Form(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form)
{
    ui->setupUi(this);
    ui->listWidget->addItems(QStringList()<<"五子棋"<<"天气预警"<<"在线音乐");
    pGomoku=new gomoku(ui->frame);
    pGomoku->hide();
    pMusic=new music(ui->frame);
    pMusic->hide();
    pWeather=new weather(ui->frame);
    pWeather->hide();
}

Form::~Form()
{
    delete ui;
}

void Form::on_listWidget_currentRowChanged(int currentRow)
{
    pGomoku->hide();
    pMusic->hide();
    pWeather->hide();
    if(currentRow==0)
    {
        pGomoku->show();
    }
    if(currentRow==1)
    {
        pWeather->show();
    }
    if(currentRow==2)
    {
        pMusic->show();
    }
}
